package testing._main;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;

import testing.manager.GenericRunner;
import testing.module.DrawAnyShapeTest;
import testing.module.DoodleWithImage;
import utilities.exceptions.JFrameNameUsedException;
import utilities.manager.Runner;
import utilities.manager.JFrameManager;
import utilities.module.Module;

public class ImgTest 
{
	public static void main(String[] args) 
	{
		Image i;
		BufferedImage bi;
		ImageIcon img;
		
		try 
		{
			bi = ImageIO.read(new File("resources//imgs//title//wingslogo.png"));
		}
		catch (IOException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		JFrame test = null;
		
		try 
		{
			//JFrameManager.makeWindow(JFRAME_TEST_NAME, new Dimension(400, 300), Color.white, true);
			test = JFrameManager.makeWindow("Image Demo", new Dimension(800, 700), Color.white, true);
		}
		catch (JFrameNameUsedException e) 
		{
			e.printStackTrace();
			System.out.println(e.toString());
		}
		
		if(test != null)
		{
			Module mod = new DoodleWithImage();
			
			Runner testMe = new GenericRunner(test.getWidth(), test.getHeight(), Color.white, mod);
			
			testMe.start();
			test.add(testMe);
		}
	}
}
